package com.laborder.sysyy.service.labs.impl;

import com.laborder.sysyy.dao.LabsDaoMapper;
import com.laborder.sysyy.entity.Labs;
import com.laborder.sysyy.service.labs.LabsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author 786107529@qq.com FJL
 * @Date 2018/9/10 11:45
 */
@Service
@Transactional
public class LabsServiceImpl implements LabsService {
    @Autowired
    private LabsDaoMapper labsDaoMapper;

    /**
     * @function: 实验室分页查询
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/12 22:08
     */
    @Override
    public List<Labs> findLabsWithPage(Map<String,Object> map) {

        return labsDaoMapper.findLabsWithPage(map);
    }
    /**
     * @function: 实验室数量查询
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/12 22:08
     */
    @Override
    public int getLabsCount(Map<String,Object>map) {
        return labsDaoMapper.getLabsCount(map);
    }
    /**
     * @function: 添加实验室
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/12 22:08
     */
    @Override
    public int saveLabsInfo(Labs labs) {

        return labsDaoMapper.saveLabsInfo(labs);
    }
    /**
     * @function:  删除学生信息
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/10 14:21
     */
    @Override
    public boolean delLabsInfo(int sId) {
        if(labsDaoMapper.delLabsInfo(sId)!=0)
            return true;
        return false;
    }
    /**
     * @function: 批量删除学生信息
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/10 14:22
     */
    @Override
    public boolean delManyLabsInfo(int sId) {
        if(labsDaoMapper.delManyLabsInfo(sId)!=0)
            return true;
        return false;
    }
    /**
     * @function: 根据Id查询实验室
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/12 22:11
     */
    @Override
    public Labs getLabsInfo(String lId) {
        return labsDaoMapper.getLabsInfo(lId);
    }
    /**
     * @function:  更新实验室信息
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/13 12:55
     */
    @Override
    public boolean updateLabsInfo(Labs labs) {
        if(labsDaoMapper.updateLabsInfo(labs)!=0){
            return true;
        }else{
            return false;
        }
    }
    /**
     * @function:  查询实验室
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/13 12:55
     */
    @Override
    public List<Labs> getAllLabs(){
        return labsDaoMapper.getAllLabs();
    }

    /**
     * @function: 根据名称和地点来进行查询
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/13 13:48
     */
    @Override
    public Labs getLabsInfoByName(String lName, String lRoom) {
        return labsDaoMapper.getLabsInfoByName(lName,lRoom);
    }


}
